perm filename DJOTTO.SAI[1,DEK]1 blob sn#133516 filedate 1974-11-30 generic text, type T, neo UTF8
00100	BEGIN comment convert jotto dictionary to directed graph;
00200	comment this is like pjotto but arcs go from abcde to bcdef;
00250	     comment and also to cdefg;
00300	comment this program assumes that the last word is ZOOMS,
00400	  although other dictionaries give later words such as
00500	   ZOONS, ZORIL, ZORRO, ZOOTY, ZOWIE, ZUDDA, ZYGON,
00600	    ZYMAD, ZYMES, ZYMIC, ZYMIN;
00700	integer chan,count,brchar,eof,flag,i,j,k,l,m,n,
00800	zz,avail,maxdist,j0,
00900	aa,msk,p,ct,ctc,x,u,q,del;
01000	string s;
01100	label done,loop,oloop;
01200	boolean newclass;
01300	integer array word,head,commn[0:6655 ];
01400	integer array edge[0:34815];
01500	chan←-1; while chan<0 do chan←getchan;
01600	open(chan,"dsk",0,2,0,count,brchar,eof);
01700	eof←0; count←6; flag←0;
01800	lookup(chan,"jotto.dic",flag);
01900	setbreak(1,"-"&'12,'15&'14&'12,"ins");
02000	n←avail←0; 
02100	word[0]←0;
02200	zz←cvasc("ZOOMS") rot -1; while word[n] < zz do begin
02300	s←input(chan,1);while length(s)=0 do s←input(chan,1);
02400	n←n+1;word[n]←cvasc(s) rot -1;
02500	head[n]←0;
02600	if word[n] leq word[n-1] then outstr("out of order "&cvstr(word[n] rot 1));
02700	if brchar='55 then commn[n]←1 else commn[n]←0;
02800	if n mod 200 = 0 then outstr(cvs(n)&" "&s);
02900	end;
03000	for i←1 step 1 until n do begin
03100	if i mod 200 = 0 then outstr(cvs(i)&" "&cvstr(word[i] rot 1));
03200	x←(word[i] land '1777777777) rot 7;
03300	l←1; u←n; while l leq u do begin
03400	q←(l+u) lsh -1;
03500	if word[q]>x then u←q-1 else l←q+1; end;
03600	while word[l] land '377777777600 = x do begin
03700	ct←ct+1;
03800	if commn[i]+commn[l]>1 then ctc←ctc+1;
03900	if i mod 200 =  0 then outstr(cvstr(word[l] rot 1));
04000	avail←avail+1;
04010	comment the next 2 lines make it undirected, for experiments;
04020	avail←avail+1;edge[avail-1]←(I rot 18)+head[l];
04030	head[l]←avail-1;
04100	edge[avail]←(l rot 18)+head[i];
04200	head[i]←avail;
04300	l←l+1;
04400	end;
04410	x←(word[i] land '7777777) rot 14;
04416	l←1; u←n; while l leq u do begin
04422	q←(l+u) lsh -1;
04428	if word[q]>x then u←q-1 else l←q+1; end;
04434	while word[l] land '377777740000 = x do begin
04440	ct←ct+1;
04446	if commn[i]+commn[l]>1 then ctc←ctc+1;
04452	if i mod 200 =  0 then outstr(cvstr(word[l] rot 1));
04458	avail←avail+1;
04459	comment the next 2 lines make it undirected, for experiments;
04460	avail←aVAIL+1;edge[avail-1]←(i rot 18)+head[l];
04461	head[l]←avail-1;
04464	edge[avail]←(l rot 18)+head[i];
04470	head[i]←avail;
04476	l←l+1;
04482	end;
04500	if i mod 200 = 0 then outstr(" "&cvs(ct)&" "&cvs(ctc)&'15&'12);
04600	end;
04700	outstr(cvs(n)&" "&cvs(ct)&" "&cvs(ctc)&'15&'12);
04775	release(chan);
04875	chan←-1; while chan<0 do chan←getchan;
04975	open(chan,"dsk",15,0,2,count,brchar,eof);
05075	enter(chan,"jotto.DGR",flag);
05175	word[0]←n;
05275	arryout(chan,word[0],6656);
05375	arryout(chan,head[0],6656);
05475	arryout(chan,commn[0],6656);
05575	arryout(chan,edge[0],34816);
05675	release(chan);
06000	END